Conversation
There was a problem hiding this comment.
Pull request overview
Adds ORCID profile linking UI for authority-controlled author metadata by detecting ORCID iDs in the authority field and rendering the author value as a link to https://orcid.org/{id} with an ORCID badge.
Changes:
- Implemented ORCID authority detection + ORCID profile URL generation in
MetadataValuesComponentandPlainTextMetadataListElementComponent. - Updated both templates to render ORCID-linked author names and a local ORCID SVG badge icon.
- Added component styling and expanded unit tests to cover ORCID cases.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts | Adds ORCID detection and URL generation helpers |
| src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.html | Renders ORCID link + badge for authority-controlled ORCID values |
| src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.scss | Adds ORCID link/badge styling for the plain-text list element |
| src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.spec.ts | Adds unit tests for ORCID detection, URL generation, and rendering |
| src/app/item-page/field-components/metadata-values/metadata-values.component.ts | Adds ORCID detection and URL generation helpers for item page metadata values |
| src/app/item-page/field-components/metadata-values/metadata-values.component.html | Adds ORCID template and prioritizes it during rendering |
| src/app/item-page/field-components/metadata-values/metadata-values.component.scss | Adds ORCID link/badge styling for item page metadata values |
| src/app/item-page/field-components/metadata-values/metadata-values.component.spec.ts | Adds unit tests for ORCID detection, URL generation, and rendering |
| PR_DESCRIPTION.md | Adds PR documentation describing the ORCID enhancement |
| isOrcidAuthority(mdValue: MetadataValue): boolean { | ||
| if (!hasValue(mdValue.authority)) { | ||
| return false; | ||
| } | ||
| const orcidPattern = /^\d{4}-\d{4}-\d{4}-\d{4}$/; | ||
| return orcidPattern.test(mdValue.authority); | ||
| } | ||
|
|
||
| /** | ||
| * Generates ORCID profile URL from authority ID | ||
| * @param authorityId - The ORCID authority ID | ||
| * @returns The full ORCID profile URL | ||
| */ | ||
| getOrcidUrl(authorityId: string): string { | ||
| return `https://orcid.org/${encodeURIComponent(authorityId)}`; | ||
| } |
There was a problem hiding this comment.
ORCID iDs can have an "X" as the final check digit; the regex ^\d{4}-\d{4}-\d{4}-\d{4}$ will reject valid ORCIDs ending in X. Update the pattern (and consider making it a shared constant since the same regex/URL is now duplicated in multiple components).
| const metadatum = this.mdRepresentation as MetadatumRepresentation; | ||
| if (!hasValue(metadatum.authority)) { | ||
| return false; | ||
| } | ||
| const orcidPattern = /^\d{4}-\d{4}-\d{4}-\d{4}$/; | ||
| return orcidPattern.test(metadatum.authority); |
There was a problem hiding this comment.
ORCID iDs can have an "X" as the final check digit (e.g. 0000-0002-1694-233X). The current regex ^\d{4}-\d{4}-\d{4}-\d{4}$ will incorrectly return false for valid ORCID values; consider updating the pattern to allow an X in the last position (and ideally hoist the regex/base URL into shared constants to avoid duplication).
…source - dso-edit-metadata-form: Fix ADD operation place handling, selective authority/confidence inclusion, language normalization - dso-edit-metadata-authority-field: Known authority fields skip vocabulary validation, use null confidence instead of CF_UNSET, track manual changes as UPDATE - dso-edit-metadata-field.service: Replace API-based vocabulary lookup with hardcoded authority fields list - vocabulary.service: Add ORCID external source search for authority fields (dc.contributor.author, dc.creator, dc.contributor.editor, dc.contributor.advisor) - dynamic-onebox.component: Skip vocabulary lookup for ORCID authority values - form-field-metadata-value.model: Default confidence to null instead of CF_UNSET Adapted from vsb-tuo/orcid-enhancement branch for Mendelu codebase (standalone components, @if/@for syntax).
Problem description
Summary
Adds ORCID profile linking for authors whose
dc.contributor.authormetadata has an ORCID ID in theauthorityfield (pattern:0000-0000-0000-0000). The author name is rendered as a clickable link tohttps://orcid.org/{id}with an ORCID badge icon.Origin
Adapted from
origin/vsb-tuo/orcid-enhancement(ab0100b71..13ca15b8b). Not available in upstream DSpace community.Changes from VSB-TUO version:
@if/@for)encodeURIComponentfor URL safetyScope
MetadataValuesComponentPlainTextMetadataListElementComponentTests
MetadataValuesComponent— 10/10 passing (+5 new)PlainTextMetadataListElementComponent— 7/7 passing (+5 new)Sync verification
If en.json5 or cs.json5 translation files were updated:
yarn run sync-i18n -t src/assets/i18n/cs.json5 -ito synchronize messages, and changes are included in this PR.Manual Testing (if applicable)
Copilot review